<template>
  <view class="new">
    <Item :datalist="list" v-if="list.length" />
    <Loading :status="loading ? 'loading' : ''" v-if="loading" />
  </view>
</template>

<script>
import { mapState, mapActions } from 'vuex'
import Item from '@/components/Item/list2v3.vue'
import Loading from '@/components/Loading'
export default {
  data() {
    return {
      list: [],
      loading: false
    }
  },
  methods: {
    ...mapActions('list', ['getList']),
    getData() {
      this.loading = true
      this.getList({
        limit: 50
      }).then(res => {
        this.list = res.data
        this.loading = false
      })
    }
  },
  mounted() {
    this.getData()
  },
  components: {
    Item,
    Loading
  }
}
</script>

<style lang="scss" scoped></style>
